FROM maven:3.8-openjdk-8-slim AS build

# 替换成本地maven库
COPY ./maven-settings-bytz.xml /root/.m2/settings.xml

RUN mkdir -p /app

WORKDIR /app

COPY pom.xml /app/
COPY bytz-boot-cms-admin-app/pom.xml /app/bytz-boot-cms-admin-app/
COPY bytz-boot-cms-mall-app/pom.xml /app/bytz-boot-cms-mall-app/
COPY bytz-boot-cms-core/pom.xml /app/bytz-boot-cms-core/
COPY bytz-boot-cms-base/pom.xml /app/bytz-boot-cms-base/

RUN mvn install

COPY ./ /app/

RUN mvn -threads 4 clean install -DskipTests
